<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix = "spring" uri = "http://www.springframework.org/tags" %>
<c:url value="/edit" var="action"/>
<head>
	<script type="text/javascript" src="<c:url value="/static/js/jquery-1.4.4.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/static/js/html-elements.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/Constants"/>"></script>
	<script type="text/javascript" src="<c:url value="/static/js/language.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/static/js/search.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/static/js/fileName.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/static/js/generateFiles.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/static/js/loading.js"/>"></script>
	<link rel="stylesheet" type="text/css" href="<c:url value="/static/css/properties-tool.css"/>"></link>
	<link rel="stylesheet" type="text/css" href="<c:url value="/static/css/loading.css"/>"></link>
</head>

<script type="text/javascript">
<!--
function changeGame(){
	getAssociatedLangs($('#selectedGame').val(),'selectedLang');
}

function generate(){
	generateFiles('selectedGame', 'selectedLang', 'selectedFileName','properties');
}

//-->
</script>

<div class="download-row">
<span class="download-cell">
	<spring:message code="key.game.label"/>
	<form:form commandName="games">
		<form:select path="" id="selectedGame" multiple="false" onchange="changeGame();">
			<form:option value="">All games</form:option>
			<form:option value="COMMONS">Common Keys</form:option>
			<form:options items="${games}" itemValue="id" itemLabel="name" />
		</form:select>
	</form:form>
</span>
<span class="download-cell">
	<spring:message code="key.language.label"/>
	<select id="selectedLang">
		<option value="" >All</option>
	</select>
</span>
<span class="download-cell">
<form:form commandName="fileNames">
	<spring:message code="key.filename.label"/>
	<form:select path="" id="selectedFileName">
		<form:option value="" >All</form:option>
		<form:options items="${fileNames}" itemValue="id" itemLabel="fileName"/>
	</form:select>
</form:form>
</span>
<span class="download-cell">
	<input type="button" value="<spring:message code="key.common.create"/>" onclick="generate();" />
</span> 
</div>

<div id="properties" class="download-table">

</div>
